﻿using System;
using System.Linq.Expressions;

namespace DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst.Configurations
{
    public class UniqueConstraintConfiguration<TEntity> : UniqueConstraintConfiguration
    {
        public new UniqueConstraintConfiguration<TEntity> WithColumn(string propertyName)
        {
            base.WithColumn(propertyName);
            return this;
        }
        public UniqueConstraintConfiguration<TEntity> WithColumn<TProperty>(Expression<Func<TEntity, TProperty>> property)
        {
            base.WithColumn(((MemberExpression)property.Body).Member.Name);
            return this;
        }
    }

    public abstract class UniqueConstraintConfiguration
    {
        public UniqueConstraintConfiguration WithColumn(string propertyName)
        {
            // TODO: add code here
            return this;
        }
    }
}